home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
001
/
pibt40s1.arc
/
FINITERM.MOD
< prev
next >
Wrap
Text File
|
1987-06-08
|
4KB
|
90 lines
(*----------------------------------------------------------------------*)
(* FiniTerm --- Finish up PibTerm *)
(*----------------------------------------------------------------------*)
PROCEDURE FiniTerm;
(*----------------------------------------------------------------------*)
(* *)
(* Procedure: FiniTerm *)
(* *)
(* Purpose: Terminates PibTerm *)
(* *)
(* Calling Sequence: *)
(* *)
(* FiniTerm; *)
(* *)
(*----------------------------------------------------------------------*)
VAR
Err : INTEGER;
I : INTEGER;
BEGIN (* FiniTerm *)
(* Make sure we're in text mode *)
TextMode( Text_Mode );
(* Close down serial port *)
Async_Close( Drop_Dtr_At_End );
(* Remove buffers *)
Async_Release_Buffers;
(* Turn off keyboard handler *)
IF Extended_Keypad THEN
Remove_Keyboard_Handler;
(* Turn off video handler *)
IF Software_Scroll THEN
Remove_Video_Handler;
(* Close all script files *)
FOR I := 1 TO MaxScriptOpenFiles DO
IF Script_File_Used[I] THEN
BEGIN
IF Script_File_List[I]^.Opened THEN
BEGIN
(*$I-*)
CLOSE( Script_File_List[I]^.F );
(*$I+*)
I := IOResult;
END;
END;
(* Close capture file *)
IF Capture_On THEN
(*$I-*)
CLOSE( Capture_File );
(*$I+*)
(* Close log file *)
IF Log_File_Open THEN
(*$I-*)
CLOSE( Log_File );
(*$I+*)
(* Close down print spooling *)
IF Print_Spooling THEN
BEGIN
Err := Close_File_Handle( Spool_File_Handle );
DISPOSE( Spool_Buffer );
END;
(* Remove scrolling buffer *)
IF Review_Buffer <> NIL THEN
FREEMEM( Review_Buffer , Max_Review_Length );
(* Remove Interrupt 24 trap *)
Int24OFF;
(* Unload all modules *)
UnloadAllModules;
(* Clear screen *)
Write_Screen_Memory := TRUE;
TimeSharingActive := FALSE;
(* Assume text mode from *)
(* current system setting. *)
CASE Current_Video_Mode OF
0, 2, 7 : Text_Mode := BW80;
1, 3, 4, 5, 6 : Text_Mode := C80;
END (* CASE *);
TextColor( LightGray );
TextBackGround( Black );
Set_Border_Color( Black );
END (* FiniTerm *);